package com.wbcs.system.component.application.report.abstractreport;


public class SaveInfoDataBean
{
    protected String updatetype;
    
    protected boolean[] shouldDoSave;

    public SaveInfoDataBean()
    {
        shouldDoSave=new boolean[]{false,false,false,false};
    }
    
    public boolean[] getShouldDoSave()
    {
        return shouldDoSave;
    }

    public void setShouldDoSave(boolean[] shouldDoSave)
    {
        this.shouldDoSave=shouldDoSave;
    }

    public String getUpdatetype()
    {
        return updatetype;
    }

    public void setUpdatetype(String updatetype)
    {
        this.updatetype=updatetype;
    }

    public boolean hasDeleteData()
    {
        if(shouldDoSave==null||shouldDoSave.length!=4) return false;
        if(shouldDoSave[2]) return true;
        if(shouldDoSave[3]&&"delete".equals(this.updatetype)) return true;
        return false;
    }

    public boolean hasSavingData()
    {
        if(shouldDoSave==null||shouldDoSave.length!=4) return false;
        if(shouldDoSave[0]||shouldDoSave[1]) return true;
        if(shouldDoSave[3]&&(updatetype==null||!updatetype.equals("delete"))) return true;
        return false;
    }
}
